﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using blackhouse.BlackApart.Business.Apartments;

namespace blackhouse.BlackApart.Business.Calendar {
    public class GroupCalendar : ICalendar {

        //#region Constructors

        //public CompositeGroupCalendar(IApartmentGroup group, DateTime startDate, DateTime endDate) : base(GetCalendars(group, startDate, endDate)) { }

        //public CompositeGroupCalendar(int groupId, DateTime startDate, DateTime endDate) : base(GetCalendars(groupId, startDate, endDate)) { }

        //#endregion

        #region Methods

        private static ICalendar GetGroupCalendar(int groupId, DateTime startDate, DateTime endDate) {
            Factory factory = Factory.Instance();
            IApartmentGroup group = null;
            if (groupId > 0)
                group = factory.GetApartmentGroup(groupId);
            return GetGroupCalendar(group, startDate, endDate);
        }

        private static ICalendar GetGroupCalendar(IApartmentGroup group, DateTime startDate, DateTime endDate) {
            Factory factory = Factory.Instance();
            return new ApartmentTypeCalendar(group, startDate, endDate);
        }

        #endregion

    }
}
